Use the faster accessor function in the sort functions
authorBenjamin Otte <otte@gnome.org>
Wed, 1 Jul 2009 08:20:04 +0000 (10:20 +0200)
committerBenjamin Otte <otte@gnome.org>
Thu, 15 Oct 2009 20:01:39 +0000 (22:01 +0200)
commitd68bca17711eb2fe7bdb05943bcd2125873d5b94
tree010896e89a4e74934c5ca05a92e807c46f31bff5
parent53a00e3cc3a6e20e8f45edd751126035feb6d184
Use the faster accessor function in the sort functions

Use the faster _gtk_file_system_model_get_value() function instead of
gtk_tree_model_get() inside the sort functions. This gives a significant
speed-up when sorting large lists.
In a test case with 40.000 files, the sorting time went from ~5 seconds
to less than 0.5 seconds for my test case. There is 2 significant
problems with gtk_tree_model_get() that cause this:
1) The value is copied, which takes quite a bit of time for strings.
   ~25% of excessive time or ~1 second in my test
2) The tree model functions need to lookup the interface vfunc. And
   gtk_tree_model_get() doesn't do that only once, but multiple times
   (verifying column id, getting the actual value, ...)
   ~75% of excessive time or ~3 seconds in my test
gtk/gtkfilechooserdefault.c